home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / gpgetenv.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  1.7 KB  |  45 lines

  1. /* Copyright (C) 1998 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: gpgetenv.h,v 1.2 2000/09/19 19:00:25 lpd Exp $ */
  20. /* Interface to platform-specific getenv routine */
  21.  
  22. #ifndef gpgetenv_INCLUDED
  23. #  define gpgetenv_INCLUDED
  24.  
  25. /*
  26.  * Get a value from the environment (getenv).
  27.  *
  28.  * If the key is missing, set *ptr = 0 (if *plen > 0), set *plen = 1,
  29.  * and return 1.
  30.  *
  31.  * If the key is present and the length len of the value (not counting
  32.  * the terminating \0) is less than *plen, copy the value to ptr, set
  33.  * *plen = len + 1, and return 0.
  34.  *
  35.  * If the key is present and len >= *plen, set *plen = len + 1,
  36.  * don't store anything at ptr, and return -1.
  37.  *
  38.  * Note that *plen is the size of the buffer, not the length of the string:
  39.  * because of the terminating \0, the maximum string length is 1 less than
  40.  * the size of the buffer.
  41.  */
  42. int gp_getenv(P3(const char *key, char *ptr, int *plen));
  43.  
  44. #endif /* gpgetenv_INCLUDED */
  45.